<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Document</title>
	</head>

		<!-- 	// 练习2 (*)
			// 编写函数feibo()计算斐波那契数列中的数，并调用它打印出
			// 1 1 2 3 5 8 13 21 34 55 ...			
			// feibo(1)	1
			// feibo(2)	1
			// feibo(3) 2
			// feibo(4) 3
			// ...			
			// 用以下代码测试
			for(var i=1;i<=10;i++)
			{
				document.write(feibo(i)+"&nbsp;");
			}
			 -->
	<body>
		<script>
			function feibo(n)
						{
							if (n <= 0) return 0;
							if (n === 1) return 1;
							return feibo(n - 1) + feibo(n - 2);
						}
						document.write(feibo(4));
		</script>
	</body>

</html>
